package org.aom.entity.base;

import java.io.Serializable;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * 统一定义id的entity基类.
 * 
 * 基类统一定义id的属性名称、数据类型、列名映射及生成策略. 子类可重载getId()函数重定义id的列名映射和生成策略.
 * 由于EditGrid里面的自动生生的数字型字段默认值为0，所以这里更改了主键为基础long型。
 * @author Saya Yang
 * 
 */
// JPA Entity基类的标识
@MappedSuperclass
public abstract class EditDataGridIdEntity implements Serializable{

	private static final long serialVersionUID = -4663797456266985942L;
	private long id;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE)
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
}
